<?php if($this->paginator->count()):?>
<table class="sm_tbl_classic" id="list_submission">
<thead>
	<tr>
		<th style="width: 200px;">
			<span>Submission</span>
		</th>		
		<th>
			<?php echo $this->partial('manage/sortable_item_control.phtml',array(
				'column' => array(
					'sort_column'   => 'votes',
					'sort_default'  => 'DESC'
				),
				'label' => 'TABLE_HEADER_VOTES'
			)) ?>
		</th>
		<th>
			<?php echo $this->partial('manage/sortable_item_control.phtml',array(
				'column' => array(
					'sort_column'   => 'shares',
					'sort_default'  => 'DESC'
				),
				'label' => 'TABLE_HEADER_SHARES'
			)) ?>
		</th>
		<th style="width: 98px !important;">
			<?php echo $this->partial('manage/sortable_item_control.phtml',array(
				'column' => array(
					'sort_column'   => 'user_score',
					'sort_default'  => 'DESC'
				),
				'label' => 'TABLE_HEADER_USER_SCORE'
			)) ?>
		</th>
		<th style="">
			<?php echo $this->partial('manage/sortable_item_control.phtml',array(
				'column' => array(
					'sort_column'   => 'score1',
					'sort_default'  => 'DESC'
				),
				'label' => 'TABLE_HEADER_SCORE_1'
			)) ?>
		</th>
		<th style="">
			<?php echo $this->partial('manage/sortable_item_control.phtml',array(
				'column' => array(
					'sort_column'   => 'score2',
					'sort_default'  => 'DESC'
				),
				'label' => 'TABLE_HEADER_SCORE_2'
			)) ?>
		</th>
		<th style="">
			<?php echo $this->partial('manage/sortable_item_control.phtml',array(
				'column' => array(
					'sort_column'   => 'total1',
					'sort_default'  => 'DESC'
				),
				'label' => 'TABLE_HEADER_TOTAL_1'
			)) ?>
		</th>
		<th style="">
			<?php echo $this->partial('manage/sortable_item_control.phtml',array(
				'column' => array(
					'sort_column'   => 'total2',
					'sort_default'  => 'DESC'
				),
				'label' => 'TABLE_HEADER_TOTAL_2'
			)) ?>
		</th>
	</tr>
</thead>
<tbody>
	<?php foreach ($this->paginator->getCurrentItems() as $entry):?>
		<?php /* @var $entry Core_Model_Entry */ ?>
		<tr>
			<td>
				<img src="<?php echo $entry->getThumbnailImageUrl();?>" class="thumb_image"/>
				<p>
				<?php echo $entry->getShortTitle() ?><br />
				by <?php echo $this->blankLink($entry->getUser()->link, $entry->getCandidateName()) ?><br />
				on <?php echo $entry->getSubmitDate() ?>
				</p>
			</td>
			<td><?php echo $entry->votes ?></td>
			<td><?php echo $entry->shares ?></td>
			<td><?php echo $entry->getUserScore() ?></td>
			<td><?php echo $entry->getScore1() ?></td>
			<td><?php echo $entry->getScore2() ?></td>
			<td><?php echo $entry->getTotalScore1() ?></td>
			<td><?php echo $entry->getTotalScore2() ?></td>
		</tr>
	<?php endforeach;?>
</tbody>
</table>
<?php echo $this->paginationControl(
		$this->paginator,
		'Sliding',
		'manage/pagination_control.phtml',
		array(
			'param_page'    => PARAM_PAGE_NAME,
			'query'         => isset($_GET[PARAM_SORT_DEFAULT])?array(PARAM_SORT_DEFAULT => $_GET[PARAM_SORT_DEFAULT]):array()
		)
	);
?>
<?php else:?>
<div class="sm_paginator_item_empty">
    <p>No item is available.</p>
</div>
<?php endif; ?>
<script>
jQuery("document").ready(function($){
	addTab('Report: <?php echo $this->contest->title ?>', '<?php echo $this->url() ?>');
});
function performAction(id)
{
	var action = this.value;
	switch (action)
	{
		case 'edit':
			top.location.href="<?php echo $this->baseUrl('/contest/entry/edit/id/');?>" + id;
			break;
		case 'judge':
			top.location.href="<?php echo $this->baseUrl('/contest/entry/judge/id_entry/');?>" + id;
			break;
	}
}
</script>

